import React from "react"
import $ from "jquery"
import "./../scss/Search.scss"
class Search extends React.Component {
	constructor(props){
		super(props);
		this.state = {
			list :[]
		}
	}
	
	componentDidMount(){
		var that = this;
		$.ajax({
			type:"get",
			url:"http://w.lefeng.com/api/neptune/search/hot_keywords/v1?count=10&highlight=1&needType=1",
			success:function(data){
				var obj = data.data;
				
					that.setState({list:obj})

			}
		});
	}
	render() {
		var arr = [];
		this.state.list.map(function(item,index){
			arr.push(<div key={index}><span>{item.word}</span></div>)
		})
		return (
			<div className="search">
			<p className="iconfont icon-remensousuo">大家都在搜</p>	
				{arr}
			</div>
		)
	}
}
export default Search;